package sample.templates;

import java.util.Enumeration;
import java.util.Vector;

public class TrashVisitor {

	public static void main(String[] args) {
		Vector bin = new Vector();
		try {
			parseTrash.fillBin("VTrash.dat", bin);
		} catch (Exception e) {
			e.printStackTrace();
		}

		PriceVisitor pv = new PriceVisitor();
		WeightVisitor wv = new WeightVisitor();

		Enumeration it = bin.elements();
		while (it.hasMoreElements()) {
			Visitable v = (Visitable) it.nextElement();
			v.accept(pv);
			v.accept(wv);
		}
		pv.total();
		wv.total();
	}

}
